import Vue from 'vue';
import App from '../src/App.vue';
import { createRouter } from '../src/router';
import { createStore } from '../src/store';
import { sync } from 'vuex-router-sync';
import VueMeta from 'vue-meta'
import { Lazyload } from 'vant'
import 'vant/es/style/normalize.css'
import '@/assets/fonts/iconfont.css'
/* if (process.env.RUN_ENV === 'server') {
  import FastClick from 'fastclick'
  FastClick.attach(document.body)
} */
Vue.use(Lazyload)
Vue.use(VueMeta)
Vue.config.productionTip = false

export function createApp() {
  const router = createRouter();
  const store = createStore();

  sync(store, router);

  const app = new Vue({
    render: (h) => h(App),
    router,
    store,
  })
  return { app, router, store };
}
